﻿<img class="cultureOption" title="English" alt="en-US" src="/Images/Common/flag-english.gif"
    data="en-US" /><a class="cultureOption" data="en-US">English</a>
<img class="cultureOption" title="Tiếng Việt" alt="vi-VN" src="/Images/Common/flag-vietnam.gif"
    data="vi-VN" /><a class="cultureOption" data="vi-VN">Tiếng Việt</a>
    
<script type="text/javascript">
    $(".cultureOption").click(function () {
        var selectedCulture = $(this).attr("data");
        $.post('@Url.Action("SetCulture", "Culture")', { "culture": selectedCulture }, function (data) {
            switch (selectedCulture) {
                case "vi-VN":
                    window.location.href = '@Url.Action("Index", "Home", new { lang = "vi" })';
                    break;
                case "en-US":
                    window.location.href = '@Url.Action("Index", "Home", new { lang = "en" })';
                    break;
                default:
                    window.location.href = '@Url.Action("Index", "Home", new { lang = "vi" })';
                    break;
            }

        });
    });
</script>
